package com.hrg.rds.biz.oc.controller;

import com.hrg.rds.biz.oc.domain.SmartIOVo;
import com.hrg.rds.biz.oc.service.SmartIOService;
import com.hrg.sys.framework.web.controller.BaseController;
import com.hrg.sys.framework.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/open/smartIO")
public class SmartIOController extends BaseController {
    @Autowired
    private SmartIOService smartIOService;

    @GetMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE)
    public AjaxResult list() {
        List<SmartIOVo> smartIOVoList = smartIOService.selectList();
        return success(smartIOVoList);
    }

    @PostMapping("/fire/{waybillTemplateId}")
    public AjaxResult saveOrUpdate(@RequestBody SmartIOVo smartIOVo) {
        smartIOService.saveOrUpdate(smartIOVo);
        return success();
    }

}
